package test_struct

import "fmt"

type Books struct {
	title  string
	author string
	bookid int
}

func DoStruct() {
	fmt.Println("结构体")
	fmt.Println(Books{author: "语文书", title: "语文老师"})

	books := Books{"语文书", "语文老师", 2343}
	fmt.Println(books)

	books.bookid = 9999
	fmt.Println(books)

	printBook(books)

	printBook2(&books)

}

func printBook(book Books) {
	fmt.Println(book)
	fmt.Println(book.title)
}

func printBook2(book *Books) {
	fmt.Println(*book)
	fmt.Println(book.title)
}
